load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//packages/ic-ed25519",
    "//packages/ic-secp256r1",
    "//rs/crypto/temp_crypto",
    "//rs/crypto/test_utils/reproducible_rng",
    "//rs/crypto/tls_interfaces",
    "//rs/crypto/utils/tls",
    "//rs/interfaces",
    "//rs/protobuf",
    "//rs/registry/fake",
    "//rs/registry/keys",
    "//rs/registry/proto_data_provider",
    "//rs/types/types",
    "@crate_index//:pkcs8",
    "@crate_index//:rand",
    "@crate_index//:rustls",
    "@crate_index//:signature",
    "@crate_index//:time",
    "@crate_index//:tokio",
    "@crate_index//:tokio-rustls",
    "@crate_index//:x509-cert",
]

DEV_DEPENDENCIES = []

MACRO_DEPENDENCIES = []

MACRO_DEV_DEPENDENCIES = []

ALIASES = {}

rust_library(
    name = "tls",
    testonly = True,
    srcs = glob(["src/**/*.rs"]),
    aliases = ALIASES,
    crate_name = "ic_crypto_test_utils_tls",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.9.0",
    deps = DEPENDENCIES,
)

rust_test(
    name = "tls_test",
    aliases = ALIASES,
    crate = ":tls",
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
